<link rel="stylesheet" href="../addons/jy_merch/css/mobile.css?v=1">
<style>
.fui-block-group {
    border-radius:0.5rem
}
.fui-block-group .fui-block-child {
    background: #fff;
}
.fui-block-group .fui-block-child .icon {height: auto; padding-top: 0.3rem; text-align: center; font-size: 1.3rem;}
.fui-block-group .fui-block-child .icon i { font-size:1.3rem;}
.fui-block-group .fui-block-child .title {
    height: auto;
    font-size: 0.6rem;
    line-height: 1.4
    text-align: center;
    color: #333;
}
</style>
<div class='fui-page fui-page-current'>
	<div ng-if="pagedata.tips" ng-click="access_json('jy_merch/manage.open/')" class="tips tips-yellow" style="margin:0">
			<i class="fa fa-bullhorn"></i> {{pagedata.tips}}
	</div>
    <div class='fui-content'>
		<div style="background: {{main.syscolor||'#05c175'}};padding:1rem 0.5rem;margin-top:0;padding-bottom:1.6rem;">
			<div class="fui-cellone" style="padding:0">
				<div class="fui-cellone-label" style="width:auto;">
					<img style="border-radius: 0.2rem;width:2.2rem;height:2.2rem" ng-src="{{tomedia(pagedata.item.logo) || '../core/resource/images/gw-user.png'}}" />
				</div>
				<div class="fui-cellone-text" style="font-size:0.7rem;color:#fff;padding-left:0.5rem">
					<div style="padding-bottom:0.2rem">
						<span class="bold">{{pagedata.item.merchname}} </span>
						<div ng-if="pagedata.item.groupid>0" style="font-size:0.6rem">
						<span class="fui-tag fui-tag-danger" style="background:linear-gradient(to right,rgba(244,221,187,0.6),rgba(235,216,174,1));color:#512f0a;width:auto;font-weight:400">{{pagedata.mygroup.groupname}}</span>
						</div>
						<div ng-if="pagedata.item.groupid>0" style="font-size:0.6rem">
						有效期:{{pagedata.item.viptime2}} 
						<span style="color:#FCC600;" ng-click="access_json('jy_merch/manage.open/')">续费>></span>
						</div>
						<div ng-if="pagedata.item.groupid<=0" style="font-size:0.6rem">
							<span style="color:#FCC600;" ng-click="access_json('jy_merch/manage.open/')">开通会员>></span>
						</div>
						<span ng-if="pagedata.item.is_yajinfee>0.00" ng-click="access_json('jy_merch/manage.yajin_log/')" class="fui-tag-red-o" style="margin-top:-0.2rem;padding:0.06rem 0.3rem;">已缴纳 ￥{{pagedata.item.is_yajinfee}}</span> 
						<span ng-if="pagedata.basic.yajin_open==1 && (!pagedata.item.is_yajinfee || pagedata.item.is_yajinfee<=0.00)" class="fui-tag-red-o" ng-click="access_json('jy_merch/manage.setyajin/')" style="margin-top:-0.2rem;padding:0.06rem 0.3rem;">缴纳保证金</span>
					</div>
					<div class="jylabel jylabel-switch-label">
								<span ng-class="{'jylabel-switch':1,'active':pagedata.isopenvoice==1}" ng-click="pagedata.isopenvoice=1;pagedata.openvoice(1);">开铃声</span>
								<span ng-class="{'jylabel-switch':1,'active':pagedata.isopenvoice!=1}" ng-click="pagedata.isopenvoice=0;pagedata.openvoice(0)">关铃声</span>
					</div>
					<div class="text">{{pagedata.item.desc}}</div>
				</div>
				<div class="fui-cellone-remark noremark" style="font-size:0.7rem;color:#fff;" href="javascript:;" ng-click="pagedata.showmerchs=true">
					 <a style="border-radius: 1rem;padding:0.2rem 0.3rem;font-size:0.6rem; background-color: rgb(255, 255, 255, 0.3);;width:auto;color:#fff"><i class="icon icon-qiehuan" style="font-size:0.6rem"></i> 切换商户</a>
				</div>
			</div>	
			<div class="fui-icon-group noborder  col-3" style="padding-top:0.5rem">
					<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="subtitle" style="font-size:0.7rem;color:#fff">营业额</div>
														<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.item.orderfee || '0.00'}}</div>
													</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="subtitle" style="font-size:0.7rem;color:#fff">订单数</div>
														<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.item.ordernum || 0}}</div>
														
													</div>
					</div>
					<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="subtitle" style="font-size:0.7rem;color:#fff">商品数</div>
														<div class="text bold" style="color:#fff;line-height:1.6rem;font-size:1rem">{{pagedata.item.goodsnum || 0}}</div>
													</div>
					</div>
			</div>			
		</div>
		<div style="padding:0.5rem;margin-top:-2.5rem">
			<div class="fui-cell-group fui-cell-click mod-group radius">
					<a class="fui-cell">
								<div class="fui-cell-icon"><i class="icon icon-caifua"></i></div>
								<div class="fui-cell-text" style="line-height:1.5">
									<div>当前可结算金额：{{pagedata.clearfee0 || '0.00'}}</div>
									<div style="color:#999;font-size:24rpx">(扣抽成：{{pagedata.commission_money0 || '0.00'}}，含运费：{{pagedata.dispatchprice || '0.00'}})</div>
									<div style="color:#999;font-size:24rpx" ng-if="pagedata.pluginset.balance_day>0">只能结算：订单完成{{pagedata.pluginset.balance_day || '0'}}天后的</div>
								</div>
								<div ng-click="access_json('jy_merch/manage.apply_add/')" class="fui-cell-remark noremark">
									<span class="jylabel jylabel-success" style="padding:0.3rem 0.6rem;border-radius:1rem;font-weight:400">结算</span>
								</div>
					</a>
			</div>
			<div class="fui-cell-group fui-cell-click mod-group" style="margin-top:0.5rem">
							<a class="fui-cell external">
								<div class="fui-cell-text bold">我的钱包</div>
								<div ng-if="pagedata.merchtixian!=1" href="javascript:;" ng-click="access_json('core/member.xunibi/')" class="fui-cell-remark" style="font-size: 0.65rem;">查看我的钱包</div>
								<div ng-if="pagedata.merchtixian==1" href="javascript:;" ng-click="access_json('jy_merch/manage.btixian/')" class="fui-cell-remark" style="font-size: 0.65rem;">前往币提现</div>
							</a>
							<div class="fui-icon-group col-4 selecter">
								<div class="fui-icon-col-sm external" style="margin:0">
									<div ng-click="access_json('core/member.red_log/')">
										<div class="text bold" style="color:{{main.syscolor || '#7c1cc9'}}">{{pagedata.ideal_money || '0.00'}}</div>
										<div class="subtitle" style="font-size:12px;color: #666;">我的红包 <span style="color:{{main.syscolor || '#4491F1'}}">查看</span></div>
									</div>
								</div>
								<div ng-repeat="(key,item) in pagedata.credit_types" class="fui-icon-col-sm external" style="margin:0">
									<div ng-click="access_json('core/member.xunibi//type='+key)">
										<div class="text bold" style="color:{{main.syscolor || '#7c1cc9'}}">{{item.fee || '0.00'}}</div>
										<div class="subtitle" style="font-size:12px;color: #666;">{{item.title}} <span style="color:{{main.syscolor || '#4491F1'}}">查看</span></div>
									</div>
								</div>
							</div>
			</div>
			<div class="fui-cell-title bold">
                营销管理
            </div>
			<div class="fui-block-group col-3">
					<a class="fui-block-child" ng-click="access_json('jy_merch/manage.coupon_list/')">
                        <div class="icon text-orange">
                            <i class="icon icon-youhuiquan"></i>
                        </div>
                        <div class="title">优惠券</div>
                    </a>
					<a class="fui-block-child" ng-click="access_json('jy_merch/manage.coupon_log/')">
                        <div class="icon text-orange">
                            <i class="icon icon-youhuiquan"></i>
                        </div>
                        <div class="title">发券记录</div>
                    </a>
					<a class="fui-block-child" ng-click="access_json('jy_merch/manage.coupon_hexiaolog/')">
                        <div class="icon text-orange">
                            <i class="icon icon-youhuiquan"></i>
                        </div>
                        <div class="title">核券记录</div>
                    </a>
					<a class="fui-block-child" ng-click="access_json('jy_merch/manage.inpaylog/')">
                        <div class="icon text-orange">
                            <i class="icon icon-yiban"></i>
                        </div>
                        <div class="title">收款记录</div>
                    </a>
					<a class="fui-block-child" ng-click="access_json('core/member.feecard/')">
                        <div class="icon text-orange">
                            <i class="icon icon-dixiaofei"></i>
                        </div>
                        <div class="title">商户账号余额</div>
                    </a>
                
        </div>
            <div class="fui-cell-title bold">
                订单管理
            </div>
            <div class="fui-block-group col-3">
                    <a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.order_list//status=1')">
                        <div class="icon text-blue">
							<i class="icon icon-daifahuo"></i>
						</div>
                        <div class="title">待发货</div>
						<div class="badge" ng-if="pagedata.status1>0">{{pagedata.status1}}</div>
                    </a>
                
                    <a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.order_list//status=0')">
                        <div class="icon text-yellow">
							<i class="icon icon-daifukuan1"></i>
						</div>
                        <div class="title">待付款</div>
						<div class="badge" ng-if="pagedata.ispay>0">{{pagedata.ispay}}</div>
                    </a>
               
                    <a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.order_list//status=2')">
                        <div class="icon text-orange">
                            <i class="icon icon-daishouhuo1"></i>
                        </div>
                        <div class="title">待收货</div>
						<div class="badge" ng-if="pagedata.status2>0">{{pagedata.status2}}</div>
                    </a>
                
        </div>
		<div class="fui-cell-title bold">
                商品管理
        </div>
        <div class="fui-block-group col-3">         
                <a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.good_list/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-tianmaopaidui"></i>
                    </div>
                    <div class="title">商品管理</div>
					<div class="badge" ng-if="pagedata.goods>0">{{pagedata.goods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.good_list//status=3')">
                    <div class="icon text-blue">
                        <i class="icon icon-delete"></i>
                    </div>
                    <div class="title">下架/回收商品</div>
					<div class="badge" ng-if="pagedata.delgoods>0">{{pagedata.delgoods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.good_list/edit')">
                    <div class="icon text-orange">
                        <i class="icon icon-shuru"></i>
                    </div>
                    <div class="title">添加商品</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_merch/manage.good_group/list/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-compass"></i>
                    </div>
                    <div class="title">商品分类</div>
                </a>
        </div>
		<div class="fui-cell-title bold">
                服务管理
        </div>
        <div class="fui-block-group col-3">         
                <a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.fuwu_list/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-tianmaopaidui"></i>
                    </div>
                    <div class="title">服务管理</div>
					<div class="badge" ng-if="pagedata.goods>0">{{pagedata.goods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.fuwu_list//status=3')">
                    <div class="icon text-blue">
                        <i class="icon icon-delete"></i>
                    </div>
                    <div class="title">下架/回收服务</div>
					<div class="badge" ng-if="pagedata.delgoods>0">{{pagedata.delgoods}}</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch.fuwu_list/edit')">
                    <div class="icon text-orange">
                        <i class="icon icon-shuru"></i>
                    </div>
                    <div class="title">添加服务</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/manage.fuwu_group/')">
                    <div class="icon text-yellow">
                        <i class="icon icon-compass"></i>
                    </div>
                    <div class="title">服务分类</div>
                </a>
        </div>
        <div class="fui-cell-title bold">
                商户管理
        </div>
        <div class="fui-block-group col-3">         
                <a class="fui-block-child" ng-click="access_json('jy_merch/manage.shop/')">
                    <div class="icon text-orange">
                        <i class="icon icon-set"></i>
                    </div>
                    <div class="title">店铺设置</div>
                </a>
				 <a class="fui-block-child" ng-click="access_json('jy_merch/manage.catefans/')">
                    <div class="icon text-orange">
                        <i class="icon icon-gerenzhongxin"></i>
                    </div>
                    <div class="title">粉丝管理</div>
                </a>
				 <a class="fui-block-child" ng-click="access_json('jy_merch/manage.member/')">
                    <div class="icon text-orange">
                        <i class="icon icon-account"></i>
                    </div>
                    <div class="title">会员管理</div>
                </a>
				<a class="fui-block-child" ng-click="access_json('jy_newpaimerch/merch//id='+pagedata.item.id)">
                    <div class="icon text-red">
                        <i class="icon icon-dianpu"></i>
                    </div>
                    <div class="title">店铺入口</div>
                </a>
        </div>
		<div class="fui-cell-title bold">
                店铺工具
         </div>
        <div class="fui-block-group col-3" style="height:auto;width:100%;margin-top:0.15rem">          
                <div ng-click="pagedata.inpayscancode()" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon icon-saoyisao2"></i>
                    </div>
                    <div class="title">扫码收款</div>
                </div>
				<div ng-click="access_json('jy_merch/verify.index/')" class="fui-block-child">
                    <div class="icon text-yellow">
                        <i class="icon icon-saoyisao2"></i>
                    </div>
                    <div class="title">核销</div>
                </div>
				<div ng-click="pagedata.payewmshow=true;pagedata.show_payverify();" class="fui-block-child">
                    <div class="icon text-orange">
                        <i class="icon jinyunicon icon-fukuanma"></i>
                    </div>
                    <div class="title">收款码</div>
                </div>
				<div ng-click="pagedata.czewmshow=true;pagedata.show_czverify();" class="fui-block-child">
                    <div class="icon text-orange">
                        <i class="icon jinyunicon icon-fukuanma"></i>
                    </div>
                    <div class="title">充值码</div>
                </div>
				<div ng-click="pagedata.ewmshow=true;pagedata.show_verify();" class="fui-block-child">
                    <div class="icon text-blue">
                        <i class="icon jinyunicon icon-qrcode"></i>
                    </div>
                    <div class="title">店铺码</div>
                </div>
				<div ng-click="access_json('jy_merch/manage.printer/')" class="fui-block-child">
                    <div class="icon text-red">
                        <i class="icon jinyunicon icon-print"></i>
                    </div>
                    <div class="title">打印机</div>
                </div>
        </div>
		<div class="fui-cell-group fui-cell-click mod-group">
					<a class="fui-cell" href="javascript:;" ng-click="access_json('jy_merch/manage.refund/')">
								<div class="fui-cell-icon"><i class="icon icon-caifua"></i></div>
								<div class="fui-cell-text">
												退款管理
								</div>
								<div class="fui-cell-remark"></div>
					</a>
		</div>
		<div class='btn btn-success block btn-submit' href="javascript:" ng-click="post_json('core/member.logout/')">退出登录</div>
    </div>
	 </div>
</div>
<div ng-if="pagedata.showmerchs" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showmerchs=false"></i>
			<div class="fui-list-group"  id="carrierInfo" style="border-radius: 0.5rem;background:#fff;margin: 0">
					<a class="fui-list"  ng-repeat="item in pagedata.merchs" href="javascript:;" ng-click="access_json('jy_newpaimerch/merch.index//merchid='+item.id)">
						<div class="fui-list-media">
							<i class="icon icon-map"></i>
						</div>
						<div class="fui-list-inner">
							<div class="subtitle" >
								<span class='realname'>{{item.merchname}}</span>
							</div>
							<div class="text address">地址：{{item.address}}</div>
						</div>
						<div class="fui-list-angle">
							<div class="angle"></div>
						</div>
					</a>
			</div>
			<div class="fui-navbar">
				<a class="nav-item btn cartbtn" ng-click="access_json('jy_newpaimerch/register/get/add=1')">添加商户</a>
				<a class="nav-item btn buybtn" ng-click="post_json('core/member.logout/')">切换账户</a>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.czewmshow" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.czewmshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 2rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">【充值码】
				</div>
				<div class='fui-cell' style="padding-bottom:0">
					<div class="fui-cell-text c">
						<div class="img_box" id="show_czverify_ewm">
						</div>
					</div>
				</div>
				<div class='fui-cell' style="margin-top:0;padding-top:0">
					<div class="fui-cell-text">
					<div class="error c">
						<p style="padding: 0 1.3rem">温馨提示：请用微信扫一扫！</p>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.payewmshow" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.payewmshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 2rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">【收款码】
				</div>
				<div class='fui-cell' style="padding-bottom:0">
					<div class="fui-cell-text c">
						<div class="img_box" id="show_payverify_ewm">
						</div>
					</div>
				</div>
				<div class='fui-cell' style="margin-top:0;padding-top:0">
					<div class="fui-cell-text">
					<div class="error c">
						<p style="padding: 0 1.3rem">温馨提示：请用微信扫一扫！</p>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-if="pagedata.ewmshow" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.ewmshow=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 2rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">【店铺码】
				</div>
				<div class='fui-cell' style="padding-bottom:0">
					<div class="fui-cell-text c">
						<div class="img_box" id="show_verify_ewm">
						</div>
					</div>
				</div>
				<div class='fui-cell' style="margin-top:0;padding-top:0">
					<div class="fui-cell-text">
					<div class="error c">
						<p style="padding: 0 1.3rem">温馨提示：请用微信扫一扫！</p>
					</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<div ng-include="sys_html('_shopfooter')"></div>
<audio id="openvoice" controls preload="auto" style="display:none;">
	<source src="../core/resource/images/neworder.mp3"></source>
</audio>
<script>
scope.pagedata.show_verify=function(){
	var url=scope.pagedata.item.url;
	scope.tool.qr(url,'show_verify_ewm',150)
}
scope.pagedata.show_czverify=function(){
	var url=scope.pagedata.item.rechargeurl;
	scope.tool.qr(url,'show_czverify_ewm',150)
}
scope.pagedata.show_payverify=function(){
	var url=scope.pagedata.item.payurl;
	scope.tool.qr(url,'show_payverify_ewm',150)
}	
scope.pagedata.openvoice=function(type){
	var voicetime = 0;
    var openvoice;
	scope.post_json('jy_merch/manage.shop/openvoice/isopenvoice='+scope.pagedata.isopenvoice,{},function(res){
	});
	if(type==1){
		 openvoice = setInterval(() => {
			if(scope.pagedata.isopenvoice!=1){
				clearInterval(openvoice);
				return false;
			}
			scope.get('jy_merch/get_data/getnew/merchid='+scope.pagedata.item.id,function(res){
						console.log('openvoice');
						//console.log(res);
						if(res!='none'){
							voicetime ++;
							$("#openvoice")[0].play();
						}
			});
		}, 10000);
	}
}
if(scope.pagedata.isopenvoice==1){
	scope.pagedata.openvoice(1);
}
scope.pagedata.inpayscancode=function () {
			console.log('scanQRCodeOK');
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					console.log(result);
					scope.access_json('jy_merch/manage.inpay//paycode='+result);
				}
			});
}
</script>